home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / debugtx.arc / 06MEMORY.DOC < prev    next >
Encoding:
Text File  |  1991-08-11  |  19.9 KB  |  430 lines

  1. CHAPTER 6   MEMORY DISPLAY OPTIONS                            6-1
  2.  
  3. Memory Display Windows
  4.  
  5. The debugger allows you to set up windows into your program 
  6. memory space. Using these windows, you can view memory in a 
  7. variety of formats.  The windows will remain in effect until you 
  8. cancel them; updating themselves automatically if the memory 
  9. changes. 
  10.  
  11. There are six single-line memory windows always present, in the 
  12. lower right portion of the screen.  In addition, you can have the 
  13. upper-right window display a 14-line page of memory values. 
  14.  
  15.  
  16. Single-Line Memory Windows
  17.  
  18. A single-line memory window line consists of a specification, 
  19. typed in by you, followed by a display, supplied by the debugger. 
  20.  
  21. To type in a specification on any one of window lines 1 through 
  22. 6, simply type the associated digit, 1 through 6, when the 
  23. debugger is in its main command-mode.  The cursor will jump to 
  24. the beginning of the memory-window line you are specifying.  You 
  25. then type in a display-format specification, followed by the 
  26. address of memory you want displayed. 
  27.  
  28. The simplest form of the display-format specification is a single 
  29. letter, signifying one of the display types available.  The 
  30. choices are: 
  31.  
  32.        B  for hexadecimal bytes
  33.        W  for hexadecimal words
  34.        N  for decimal bytes
  35.        D  for decimal words
  36.        Q  for octal bytes
  37.        O  for octal words
  38.        T  for text; each byte reduced to one ASCII display-
  39.              character 
  40.        A  for ASCII text, each byte occupying 2 display-
  41.              characters 
  42.        C  for ASCII characters, occupying 2 bytes if needed, 
  43.              otherwise one 
  44.  
  45. A format-specification of one of the above letters will cause the 
  46. debugger to display the array of bytes starting at the address 
  47. you specify, in the format indicated by the letter, as long as 
  48. there is room on the line. All letters in a format-specification 
  49. (or in any other context in the debugger) can be typed in either 
  50. upper- or lower-case. 
  51.                                                              6-2
  52.  
  53. The format-specification should be terminated by a comma.  After 
  54. the comma (and an optional space), you type the address of memory 
  55. you want displayed. This consists of two values, the segment 
  56. followed by the offset.  The values should be separated by a 
  57. comma. You can omit the segment value if you wish: in that case, 
  58. the current value of DS is used. The debugger reminds you that 
  59. you have specified this option by following what you type with 2 
  60. commas instead of one. 
  61.  
  62. The value you type can take one of the following forms:
  63.    a. a numeric constant, whose format is just as in the assembly 
  64.       language (leading zero means default hex, otherwise default 
  65.       decimal) 
  66.    b. a register name (IP is now accepted as a register name) 
  67.    c. a user-symbol from the assembly-language program being 
  68.       debugged. 
  69.  
  70. After you type the address-specification, you hit the ENTER key, 
  71. and the debugger fills out the rest of the line with the memory 
  72. display. 
  73.  
  74. For example, if you want to display hex bytes starting at 01000 
  75. hex on display-line 2, you type 2b,01000<ENTER>. The cursor jumps 
  76. to the line immediately when you type the 2, and it displays the 
  77. b,01000 on the line as you type it.  The b says you want hex 
  78. bytes, and the 01000 has a leading zero to signify a hexadecimal 
  79. address, not decimal.  When you press the ENTER key, the debugger 
  80. displays two commas, followed by the hex bytes.  If the memory is 
  81. zeroed, you will see 00 00 00 00 00 etc. to the end of the 
  82. display-line. 
  83.  
  84.  
  85. Erasing Memory Display Lines
  86.  
  87. Any memory-display window that you specify will remain in effect, 
  88. always updated to show the latest memory contents, until you 
  89. explicitly erase it. To erase a window, you type the number of 
  90. the window, followed by either a blank or the ENTER key.  The 
  91. line will also be erased if you start typing a format-
  92. specification, and you hit the ENTER key before you get to your 
  93. address-specification. 
  94.  
  95. In the coming sections, many of the examples assume (and they say 
  96. so) that your display is blank before you type in the example.  
  97. You can always get a blank display by typing in each number 
  98. followed by a blank: "1 2 3 4 5 6 ". 
  99.  
  100. If you accidentally type a digit and DON'T want to erase the line 
  101. your cursor has jumped to, press the ESC key to return to the 
  102. main command mode.
  103.                                                              6-3
  104. Continuation Lines
  105.  
  106. You may continue a memory-display window onto the next line, by 
  107. placing a double-quote mark " at the beginning of the next line.  
  108. You may do this in one of two ways: you may type the number of 
  109. the next line, followed by the double-quote mark; or you may 
  110. simply type the double-quote mark at the command level.  The 
  111. first method allows you to specify which window-line you want 
  112. continued, if there is more than one.  The second method is more 
  113. convenient to use.  It places the quote-mark on the last blank-
  114. line that immediately follows a non-blank line. 
  115.  
  116. You may continue placing "-marks on as many lines as you have, 
  117. creating a multi-line display. 
  118.  
  119. The debugger follows the "-mark with the address of memory being 
  120. displayed, followed by the memory, according to the start of the 
  121. type-specification of the line being continued.  The memory 
  122. display is aligned with the display of above line. 
  123.  
  124. If you are creating a multi-line display, and your specification 
  125. is a long one, you may wish to start the display at the beginning 
  126. of the next line, rather than after the specification on the 
  127. first line.  This will often give you more room.  You do this by 
  128. terminating the format-specification with a slash / instead of a 
  129. comma.  For example, to display many hex bytes at the array 
  130. BYTE_ARRAY, type 1b/byte_array<ENTER>""""" when the memory-
  131. display is empty. 
  132.  
  133.  
  134. Mixed Format Specification
  135.  
  136. Instead of having all your bytes or words on a line displayed in 
  137. the same format, you can mix your formats.  You do this by 
  138. providing more than one letter in your format-specification.  The 
  139. debugger will display one memory unit for each letter-type you 
  140. specify.  The line will be filled out with the last type given.  
  141. For example, if you type 3nwb,01000<ENTER>, you will get a 
  142. display on memory-line 3 of the decimal byte at 01000, the hex 
  143. word at 01001, and an array of hex bytes starting at 01003. 
  144.  
  145.  
  146. Numbers in a Format Specification
  147.  
  148. You may precede any letter in a format specification with a 
  149. number up to 255. The effect is the same as if you had repeated 
  150. the letter the given number of times.  For example, if you type 1 
  151. to go to memory line 1, followed by 4w10tb,02000<ENTER>, you will 
  152. get 4 hex words at 02000, 10 text characters at 02008, and an 
  153. array of hex bytes from 02012 filling out the rest of the line. 
  154.  
  155. You may also end your format specification with a number up to 
  156. 255.  This will cause the entire specification to be repeated the 
  157. given number of times. If there is room on the line for the full 
  158. number given, the display will stop there-- there will be no 
  159.                                                              6-4
  160.  
  161. repeating of the last type-byte.  If there is not room on the 
  162. line for the full number of global iterations, the debugger will 
  163. stop at the end of the last iteration that would fit.  For 
  164. example, the specification b8 causes 8 hex bytes to be displayed, 
  165. and the remainder of the display line to be blank.  The 
  166. specification b3w9 will cause the debugger to try to output 9 
  167. records, each consisting of a hex byte followed by 3 hex words.  
  168. After putting out 2 such records, the debugger will see that 
  169. there is not room for a third full record, so it will stop.  This 
  170. stopping at the record-boundary allows you to continue the 
  171. display, with correct alignment, on subsequent lines. 
  172.  
  173.  
  174. Spacing Between Memory-Display Units
  175.  
  176. In general, the debugger provides a space between each unit (byte 
  177. or word) it displays.  There is an exception, however: the 
  178. debugger will not space between adjacent text-characters (A,C, or 
  179. T specifications). 
  180.  
  181. There are special specifiers G, J, and M, described in the 
  182. section below, that allow you to override the debugger's spacing 
  183. policies. 
  184.  
  185.  
  186. Special-Action Format Specifiers
  187.  
  188. In addition to the 9 letters already mentioned that specify data 
  189. types, there are 10 other letters, and 2 other characters, that 
  190. cause the debugger to perform special actions.  Following is a 
  191. complete description all 21 non-digit characters that can occur 
  192. within a format specification: 
  193.  
  194. =  causes a display, using the format of the letter following =, 
  195.    of the current memory pointer value, instead of the contents 
  196.    of the memory location.  If a letter does not follow the =, 
  197.    then W is used; i.e., the pointer is display as a 4-digit hex 
  198.    word.  There are two uses for this feature that come to mind: 
  199.  
  200.    * If your address specification is symbolic, you can display 
  201.      the equivalent numeric address with =w, telling you exactly 
  202.      where the symbol is in memory.  Note that this display 
  203.      implicitly occurs at the beginning of continuation lines.  
  204.      If the format-specification begins with =, then the implicit 
  205.      display is suppressed, because the same address is given 
  206.      explicitly by the L. 
  207.  
  208.    * You can display the values of registers in a format other 
  209.      than hex.  For example, in the 8086 debugger you can display 
  210.      AX as a decimal number by specifying =d1,ax on one of the 
  211.      memory-display lines. 
  212.                                                              6-5
  213.  
  214. @  causes the debugger to read the next byte it was going to 
  215.    display, and instead of displaying the byte, use it as a 
  216.    count, to repeat the next letter in the specification.  The 
  217.    debugger uses only the bottom 7 bits of the memory byte for 
  218.    the count.  For example, of the memory contains a length byte 
  219.    followed by that number of text characters, the text could be 
  220.    displayed by specifying @t (or @a or @c, depending on what you 
  221.    want the display to look like).  If the memory contains 05 41 
  222.    42 43 44 45, the @t would cause ABCDE to be displayed. 
  223.  
  224. A  causes a display of a single ASCII byte, always using 2 
  225.    display bytes. The following table shows what is displayed for 
  226.    unusual bytes: 
  227.  
  228.     range of N         display of N               Example
  229.     ----------         ------------               -------
  230.      00--1F            ^ followed by N+040         02 is ^B
  231.      22                ""
  232.      23                "#
  233.      24                "$
  234.      5E                "^
  235.      7F                ^r  (r stands for rubout)
  236.      80--9F            $ followed by N-080+040     081 is $A
  237.      A0--FE            # followed by N-080         0B1 is #1
  238.      FF                $r
  239.  
  240.    All other bytes cause a display of a space following by the 
  241.    appropriate ASCII byte.  The A specification is used when you 
  242.    need guaranteed display length for proper alignment of 
  243.    continuation lines; and you do not want the potential loss of 
  244.    information provided by the single-byte T specification. 
  245.  
  246. B  causes a display of a single byte as a 2-digit hexadecimal 
  247.    number.  Numbers less than hex 10 have a leading 0, so that 
  248.    the display is always 2 digits. 
  249.  
  250. C  causes a display of a single ASCII character, just as the A 
  251.    specification, except that normal characters (not in the 
  252.    table) display as just one byte, without the preceding space. 
  253.  
  254. D  causes the display of a 16-bit word as an unsigned positive 
  255.    decimal number. There will be no leading zeros in the display; 
  256.    so the length of the display depends on the size of the 
  257.    number. 
  258.  
  259. F  causes the display of a floating-point number, in one of the 
  260.    three formats recognized by the 8087.  You must have a 
  261.    floating-point chip (8087 or 287) installed in your computer 
  262.    for this to work.  You specify which of the three formats you 
  263.    are reading by one of three letters immediately following the 
  264.    letter F:
  265.  
  266.    FD specifies a 4-byte Doubleword (single precision) number
  267.    FQ specifies an 8-byte Quadword (double precision) number
  268.    FT specifies a Ten-byte number-- 8087 extended precision.
  269.                                                              6-6
  270.  
  271. G  causes a gap between the adjacent display-formats, of one 
  272.    space more than there would have been without the G.  For 
  273.    adjacent string bytes, this means a space where there would 
  274.    have been none.  For other data types, this means two spaces 
  275.    where there would have been one. 
  276.  
  277. J  (join) causes two adjacent data types, that would have had a 
  278.    space between them, to have no space. 
  279.  
  280. L  (line) causes the display of an entire text line, using the C-
  281.    format for each character of the line.  The debugger does not 
  282.    display the terminating carriage return; nor does it display 
  283.    the following linefeed if there is one.  (If you want it to, 
  284.    specify LUC or LUUCC instead of L.)  If a carriage return is 
  285.    not found and the display line fills, then the L-specifier is 
  286.    cut off in mid-string.  Any continuation line will start up 
  287.    at the beginning of the format specification, at the mid-
  288.    string place in memory. 
  289.  
  290. M  (mark) causes a vertical-bars output to be made.  The output 
  291.    will replace a separating space that would have been output in 
  292.    the position.  If you want the space, you can provide G on 
  293.    either side (or both sides) of the M. 
  294.  
  295. N  (number) causes the display of an 8-bit byte as an unsigned 
  296.    positive decimal number.  There will be no leading zeroes in 
  297.    the display; so the length of the display depends on the size 
  298.    of the number. 
  299.  
  300. O  causes a display of a 16-bit word as a 6-digit octal number.  
  301.    Numbers less than octal 100000 have one or more leading 
  302.    zeroes, so that the display is always 6 digits. 
  303.  
  304. Q  causes a display of a single byte as a 3-digit octal number.  
  305.    Numbers less than octal 100 have one or more leading zeroes, 
  306.    so that the display is always 3 digits. 
  307.  
  308. S  causes the display of an entire null-terminated string, using 
  309.    the C-format for each character of the string.  The 
  310.    terminating null (hex 00) does not generate a display (if you 
  311.    want it to, specify SUC instead of S).  If a null is not found 
  312.    and the display line fills, then the S-specifier is cut off in 
  313.    mid-string.  Any continuation line would start up at the 
  314.    beginning of the format specification, at the mid-string place 
  315.    in memory. 
  316.  
  317. T  causes the display of a single ASCII text byte, with a 
  318.    guaranteed display-space of one character.  The character 
  319.    displayed is the same as the second character of the A-format.  
  320.    This means that you will not be able to tell the difference 
  321.    between normal, displaying ASCII characters, and their control 
  322.    and non-ASCII counterparts.  You gain a compact 
  323.    representation, but you also gain ambiguity. 
  324.                                                              6-7
  325.  
  326. U  (unskip) causes the memory display pointer to decrement by one 
  327.    byte.   No display is generated by this command.  This command 
  328.    is useful in several contexts: 
  329.  
  330.    * displaying memory in more than one format.  For example, the 
  331.      specification 8b8u2g8a gives a hex-and-ASCII side-by-side 
  332.      display, similar to that provided by many memory-dump 
  333.      programs. 
  334.  
  335.    * displaying memory out of its sequence order.  To test your 
  336.      understanding of the special-action letters in a format 
  337.      specification, you should convince yourself that the 
  338.      specification xb2ujbx99/ gives the same display on the 
  339.      following "-continuation line as the specification w/ does. 
  340.  
  341.    * displaying the count-byte consumed by the @ character.  For 
  342.      example, instead of @t, you could specify nu@t, which would 
  343.      display the string count as well as the string.  If memory 
  344.      were 05 41 42 43 44 45, this would be 5 ABCDE. 
  345.  
  346. W  causes a display of a 16-bit word as a 4-digit hex number.  
  347.    Numbers less than hex 1000 have one or more leading zeroes, so 
  348.    that the display is always 4 digits. 
  349.  
  350. X  causes the debugger to skip over the memory byte currently 
  351.    pointed to, without displaying it.  The memory pointer is thus 
  352.    incremented. 
  353.  
  354. Z  is given immediately following another format letter.  It 
  355.    causes the display to fill out the line with displays of the 
  356.    given preceding format; but instead of starting with the given 
  357.    address, the debugger starts with a lower address, and 
  358.    displays memory up to but not including the given address. 
  359.  
  360.    The most common usage of Z is to display the memory just 
  361.    output by a moving output pointer.  For example, in the 8086 
  362.    debugger, you could specify bz,es,di to display the hex bytes 
  363.    most recently output by the STOSB instruction. 
  364.  
  365.    Note that Z makes sense only in a limited number of contexts.  
  366.    You will almost certainly want to use Z only as the second 
  367.    letter of a two-letter specification, as in the example above.  
  368.    I further recommend that you use a format-letter that generates a 
  369.    fixed-length display; i.e., B,W,Q,O,T, or C.  If you 
  370.    use a variable-length display (N,D, or A), the debugger will 
  371.    be as pessimistic as possible about the number of display 
  372.    characters needed, so that the display will likely terminate 
  373.    before the end of the line. 
  374.  
  375.    A continuation of a Z-line will produce the same output as the 
  376.    original line.  If you want to continue beyond the address 
  377.    given, repeat the specification without the Z. 
  378.                                                              6-8
  379.  
  380.    I now discuss what happens if you use Z in other contexts.  
  381.    Unless your taste runs to the bizarre, you should skip this 
  382.    paragraph.  Since Z fills out a line, there should be no 
  383.    specifiers after Z: they would be ignored.  Also note that Z 
  384.    has an effect only on the single letter that precedes it.  If 
  385.    you precede Z with more than one letter, you will get a 
  386.    confusing effect: the display would start out forward from the 
  387.    address, then it would retreat when it got to Z's preceding 
  388.    letter.  The Z-array would run up to the address reached 
  389.    before, which is forward from the address you specified. 
  390.  
  391.  
  392. The Data Memory Window
  393.  
  394. You may cause the switchable window in the upper right quadrant 
  395. of the screen to display 14 lines of memory, continuing from the 
  396. last of the lines you specified within the 6-line memory area.  
  397. To do this, you:
  398.  
  399. 1. Type a format-and-address specification on one of the numbered 
  400.    memory lines, as previously described in this chapter.  For 
  401.    example, to display Bytes at location DS:0100, type 6b,ds,0100 
  402.    followed by the ENTER key.
  403.  
  404. 2. If you have already selected the memory window, you'll 
  405.    automatically have a continuation of the memory line you just 
  406.    specified, into the upper right quadrant of the screen.  If 
  407.    not, you may select the window by pressing either and ctrl-N 
  408.    or ctrl-P keys.
  409.                                                              6-9
  410.  
  411. Once you have set up a 14-line window, you may page through 
  412. memory with the Ctrl-N (Next memory page) and Ctrl-P (Previous 
  413. memory page) keys, described in Chapter 4.
  414.  
  415. If, after having pressed Ctrl-N or Ctrl-P several times, you wish 
  416. to return to the first window continuing from the address you 
  417. specified, you may do so by typing the digit (1 to 6) of the last 
  418. specification line, followed immediately by the ESC key to 
  419. preserve the specification settings.  The memory window will be 
  420. reset to its continuation value.  For example, if your 
  421. specification was on line 6, you type 6 followed immediately by 
  422. the ESC key.
  423.  
  424. If you want your 14-line memory window to start at a certain 
  425. address instead of continuing from a 1-line display, you can 
  426. separate the format and the address with a slash instead of a 
  427. comma.  For example, if you want Words at location ES:0, type 6 
  428. followed by w/es,0 followed by the ENTER key.
  429.  
  430.